package finance

class LnService {

    static transactional = true

    def ln(numbers) {
		def result = []
		
		numbers.each {
			if(it != 0) 
				result << Math.log(Math.abs(it))
	    }
		
		return result
    }
	
    def deltaLn(numbers) {
		def result = []
		
		for(int i in 1..<numbers.size()) {
			if(numbers[i] != 0 && numbers[i - 1] != 0)
				result << Math.log(Math.abs(numbers[i])) - Math.log(Math.abs(numbers[i-1]))
		}
		
		return result
    }
}
